# -*- coding:utf-8 -*-

from com.mat.rpa.utils.globalConstants import GlobalConstants
from com.mat.rpa.views.workWindow.leftPanel.directiveTree import treeItem
from . import dataProcessingConstants
from .textOperation import textOperationSubDirectiveTree
from .listOperation import listOperationSubDirectiveTree
from .dictOperation import dictOperationSubDirectiveTree
from .datetimeOperation import datetimeOperationSubDirectiveTree
from .CSVOperation import CSVOperationSubDirectiveTree
from .JSONConvertion import JSONConvertionSubDirectiveTree
from .base64Dodec import base64CodecSubDirectiveTree

class DataProcessingSubDirectiveTree(treeItem.TreeItemWithID):
    def __init__(self, parent):
        super(DataProcessingSubDirectiveTree, self).__init__(parent)
        self.createDataProcessingTreeNode()

    def createDataProcessingTreeNode(self):
        self.nodeType = GlobalConstants.treeBranchType
        self.directiveType = "dataProcessing"
        self.setText(0,"数据处理(文本、列表、变量...)")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, dataProcessingConstants.DataProcessingConstants.settingVariableDirective, "设置变量")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, dataProcessingConstants.DataProcessingConstants.generatingRandomNumberDirective, "产生随机")
        textOperationSubDirectiveTree.TextOperationSubDirectiveTree(self) #挂载文本操作子节点
        listOperationSubDirectiveTree.ListOperationSubDirectiveTree(self) #挂载列表操作子节点
        dictOperationSubDirectiveTree.DictOperationSubDirectiveTree(self) #挂载字典操作子节点
        datetimeOperationSubDirectiveTree.DictOperationSubDirectiveTree(self) #挂载日期时间操作子节点
        CSVOperationSubDirectiveTree.CSVOperationSubDirectiveTree(self) #挂载CSV操作子节点
        JSONConvertionSubDirectiveTree.JSONConvertionSubDirectiveTree(self) #挂载JSON转换子节点
        base64CodecSubDirectiveTree.Base64CodecSubDirectiveTree(self) #挂载Base64编解码子节点